package service;

public class User {
    private int id;
    private String name;
    private String password;
    private Car car;

    public void goSchool(){
        String str1=this.getCar().start();
        String str2="正在开"+this.getCar().getName()+"去学校";
        String str3="到达学校。"+this.getCar().stop();
        System.out.println(str1+"\n"+str2+"\n"+str3);
    }

    public void goHome(){
        String str1=this.getCar().start();
        String str2="正在开"+this.getCar().getName()+"回家";
        String str3="到地方了。"+this.getCar().stop();
        System.out.println(str1+"\n"+str2+"\n"+str3);
    }
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void getUser(){
        System.out.println("这是一个Spring例");
    }
    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

}
